package util;

enum Standard {
	EU, UK, US, INTERNATIONAL;
}

enum Gender {
	Male, Female;
}

final class YbSize {
	private final String value;
	private final String description;
	
	YbSize (String value, String description) {
		this.value = value;
		this.description = description;
	}
	
	public static YbSize getInstance(String value, String description) {
		return new YbSize(value, description);
	}
	
	public YbSize(double value, String description) {
		this.value = String.valueOf(value);
		this.description = description;
	}
	public String getValue() {
		return value;
	}
	public String getDescription() {
		return description;
	}
	
	
}

public final class YbSizeTable {
	
	private final YbSize[] sizes;
	private final Gender gender;
	private final Standard standard;

	public static final YbSizeTable SHOES_US_FEMALE_STANDARD = new YbSizeTable(
			new double[] { 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 10, 10.5, 11,
					11.5, 12, 12.5, 13, 13.5 }, Gender.Female, Standard.US);
	
	public static final YbSizeTable SHOES_US_MALE_STANDARD = new YbSizeTable(
			new double[] { 6, 6.5, 7, 7.5, 8, 8.5, 9, 10, 10.5, 11, 11.5, 12,
					12.5, 13, 13.5, 14 }, Gender.Male, Standard.US);
	

	public YbSizeTable(YbSize[] sizes, Gender gender, Standard standard) {
		this.sizes = sizes;
		this.gender = gender;
		this.standard = standard;
	}
	
	public YbSizeTable(String[] values, Gender gender, Standard standard) {
		this.sizes = buildSize(values);
		this.gender = gender;
		this.standard = standard;
	}

	public YbSizeTable(double[] values, Gender gender, Standard standard) {
		this.sizes = buildSize(values);
		this.gender = gender;
		this.standard = standard;
	}
	
	private static YbSize buildYbSize(String value, String des) {
		return YbSize.getInstance(value, des);
	}
	
	private YbSize[] buildSize(double[] values) {
		YbSize[] ybSizes = new YbSize[values.length];
		for(int i = 0; i < ybSizes.length; i ++) {
			ybSizes[i] = new YbSize(values[i], "");
		}
		return ybSizes;
	}
	
	private YbSize[] buildSize(String[] values) {
		YbSize[] ybSizes = new YbSize[values.length];
		for(int i = 0; i < ybSizes.length; i ++) {
			ybSizes[i] = new YbSize(values[i], "");
		}
		return ybSizes;
	}

	public YbSize[] getSizes() {
		return sizes;
	}

	public Gender getGender() {
		return gender;
	}

	public Standard getStandard() {
		return standard;
	}

}
